import Vue from "vue"
import Vuex from 'vuex'
import mutations from './mutations'
import actions from './actions'
import getters from './getters'
import { getStor } from '@/config/storage'
import { TOKEN_KEY, CHANNELS_ARR, TOUTIAO_SEARCHRESULT } from '@/store/mutation-type'

Vue.use(Vuex)

const state = {
    user: getStor(TOKEN_KEY),
    channelsArr: getStor(CHANNELS_ARR), // 存储用户频道数据
    searchSuggestion: getStor(TOUTIAO_SEARCHRESULT) || [],
}


export default new Vuex.Store({
    mutations,
    actions,
    getters,
    state
})
